package com.twu.biblioteca;

/**
 * Created by sahelig on 22/06/14.
 */

import java.util.HashMap;

/**
 * Created by sahelig on 19/06/14.
 */
public class Users
{
    private HashMap<String,UserInformation> userList=new HashMap<String, UserInformation>();
    public Users()
    {
        userList.put("BLR-0000",new UserInformation("Saheli","gangulysaheli2@gmail.com","7205771084","abcd"));
        userList.put("BLR-0001",new UserInformation("Padma","padmavb@thoughtworks.com","2306458","abcd"));
    }
    private String getPasswordForUserName(String username)
    {
        if(userList.containsKey(username))
            return userList.get(username).getPassword();
        else
            return null;
    }
    public boolean verifyDetailsDuringLogin(String username, String password)
    {
        String storedPassword=getPasswordForUserName(username);
        if(storedPassword.equals(password))
            return true;
        else
            return false;

    }
    public String getInfoForCorrespondingLibraryNumber(String libraryNumber)
    {

        return libraryNumber+"              "+userList.get(libraryNumber).getName()+"      "+userList.get(libraryNumber).getEmail()+"  "+userList.get(libraryNumber).getPhoneNumber();
    }
}
